class Film < CachedModel
  set_table_name 'film'
  set_primary_key 'ID_film'
  has_many :repertuar_elements,
    :class_name => "Repertuar",
    :foreign_key => "ID_film"

  has_many :obce_filmy,
    :class_name => "FilmObcy",
    :foreign_key => "ID_film"

  include FilmCommon

  def self.clean_up_title title
    return "" if title.blank?
    new_title = title.dup.strip
    new_title.gsub(' ','').gsub('.','').gsub(',','').gsub('!','').gsub('-','').gsub('?','').gsub(':','').gsub(';','').gsub('"','').gsub('`','').gsub("'","").chars.downcase
  end

end
